Repository navigation
M5:远程版、上传与导入导出(含全仓库审查重构与依赖更新) - #11
Merged
Merged
Conversation
chialecode
force-pushed
the
codex/m5-remote
branch
from
November 21, 2026 06:27
403de6b to
8c1803d
Compare
…full-codebase audit Stage TRACE-M5-01 (DEC-062, FR-REMOTE-001..008, AC-56..64): - trace-server (cmd/trace-server, CGO off, no UI packages) runs on Linux VPS: init/run/token/version/upload-test/rclone-filter; HTTPS with a self-signed certificate pinned by the connection code, token hash, failure limiting, body limit and protocol handshake; no renewal and no full cache on the remote; SIGTERM pauses and finalizes recordings. - Built-in upload drives rclone per item: media first, item.json last, delete only after confirmation, error classes with backoff, resume from upload_files after restart. - Every unfinished file is *.part or .trace-*; legacy in-progress names are adopted; items carry cachedBy from node.json; Linux credentials use a random key file. - Desktop: Settings > 远程 (connect, status, sync subscriptions and cookies, pending-cookie retry); library import page with six-way scan, conflict choices and verified resumable copies; export of the current filter; tasks section 导入导出; subscription file export and import with preview; two-node live merge. - tools: package -server (linux amd64/arm64 tar.gz + SHA256SUMS), smoke -server with a fake rclone, check dual-GOOS dependency rules and cross builds, six new uishots scenes; CI runs the remote smoke. - Dependencies (DEC-048): mp4ff v0.63.0, mygo v0.9.0, x/image v0.48.0 (folds PR #9), x/text v0.44.0. tools/deps -audit passes with 0 called vulnerabilities. Removes stray package.exe. Dev feedback 2026-11-20 (DEC-063): fix Douyin live start re-entry self-deadlock; store Douyin co-creations under the account they were cached for (via collab, download_tasks.via_json); fall back to a note's top-level play_addr for music and allow public HTTPS redirects for music downloads; show the subscription name on Home posts; let cache queues re-cache incomplete items and count Douyin co-creations under the member. Full-codebase audit, bugfix, cleanup and refactor (2026-11-21): - Security and isolation: harden OSDesktop.OpenExternalURL to http/https, wire GuardedMediaDialer into Bilibili/Douyin media transports and fix proxy-allowlist/IP-blocklist gaps, enforce per-site login in Douyin image/avatar fetches, mask and clear remote connection codes/tokens, redact signed URLs/tokens in SiteError/RoomState/logs/sitecheck, reject Windows NTFS junctions (ModeIrregular) and strict link checks on writes/deletes, enforce fail-closed actcheck/sitecheck category limits, and bound smoke/uishots output cleanup to artifacts/. - Data safety and core pipelines: fix subscription Delete non-numeric miss wiping Douyin subscriptions, sub_id unlink/move collisions, OpenSQLite corruption-only recovery and WAL schema guard, remote allow-moved-files mode in library.Store, upload --files-from-raw write error check and busy/corrupt CPU spins, MergeItemMetadata live segment ordering/dedup/supplement merges, download staging/status-poisoning/ context-cancel/64-bit elst fixes, live FLV PacketTypeMetadata=4/GOP/ cover write-order/moved-dir/re-entrant stop/data-race fixes, and Media Foundation COM teardown UAF/pendingReads/cancel-deadlock/ splitDecoder SampleRate-Channels/NV12 odd-dimension fixes. - Service, shell and UI: release mutexes before event publishing, run cleanup on mygo.App.OnQuit before auto-update Relaunch, isolate PauseAllActiveWork per site (LOOP-016), serialize tray updates, fix remote 30s refresh busy-spin, MediaDecoder disposal on close-to-tray, coverless video tile mp4 reads, per-frame SQLite/disk/alloc hotspots, IME/modal/narrow-width bugs, and update.Controller busy-handoff race. - Cleanup and maintainability: decompose oversized files across download, live, library, subscription, service, shell, ui, and tools; consolidate shared idle readers, URL sanitizers, dialog/avatar helpers, and build checksums; remove unused OPML subsystem, dead helpers, legacy feedback test names, stale README/docs versions, and legacy stage/issue comments (LOOP-007). Dev feedback 2026-11-21 (downloads, library attribution, task UI): - Allow bytednsdoc.com in Douyin media host allowlist for fallback note music (HTTPS 443, GuardedMediaDialer, 0 Cookie). - Propagate need_set_token/is_need_set_cookie on Douyin streams and add authenticated no-redirect ResolvePlayRedirect on www.douyin.com (/aweme/v1/play/) resolving into cookieless CDN URLs (0 Cookie on CDN) for need_set_token note video/live-photo clips and 403 fallback. - Map Bilibili code=4101152 to ErrKindUnavailable and skip ephemeral DYNAMIC_TYPE_LIVE_RCMD items in dynamic cache queues. - Attribute Bilibili forwarded videos (via.reason="forward") to the forwarder in library Statistics/ListItems/LatestPubByAuthor/CountCachedWorks so original uploaders do not appear as phantom library authors. - Preserve user-page forUID/forName context when opening a Douyin co-creation into douyin_work_view and caching from the detail view. - Fix right-edge clipping on download task cards (Shrink(1)), preserve and backfill partial missing reasons, and style partial bars/banners. Verification: go run ./tools/check (all tested packages, dual-GOOS dep check, Linux amd64/arm64 trace-server build & vet, checkdocs), tools/deps -audit (0 called), tools/uishots (192/192 pass), bounded real-site verification of 3 Douyin notes (complete, 0 cookie leaks), tools/package -install (0.1.3-dev.202611210624) & -server, desktop smoke & server smoke pass. go test -race (no cgo/gcc on host) and H-001/H-002/H-003 remain not-run. Report: docs/delivery/stage-report.md. Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
chialecode
force-pushed
the
codex/m5-remote
branch
from
November 21, 2026 06:48
8c1803d to
468dacc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
M5 远程版、内置上传、媒体库导入导出、全仓库代码审查重构、依赖更新、无用代码/文档清理及 2026-11-21 开发版下载/媒体库归属/任务卡片问题修复(单阶段单 DCO 提交)。
主要改动
cmd/trace-server(Linuxamd64/arm64,CGO_ENABLED=0,不链接界面/播放器/外壳):init/run/token/version/upload-test/rclone-filter、TLS 1.3 自签名指纹固定 HTTPS + 令牌哈希鉴权 + 失败限流、Linux AES-GCM 凭证、内置 rclone 逐条目上传与确认后删除、所有未完成临时文件统一*.part/.trace-*。设置 › 远程、媒体库六分类扫描与增量导入/导出、任务 › 导入导出、订阅文件导出/预览导入、双节点直播段合并。tools/package -server、tools/smoke -server、双 GOOS 依赖边界与 Linux 交叉编译检查、CI 运行 Linux 远程冒烟。OSDesktop.OpenExternalURL协议限制、GuardedMediaDialer接入两站媒体传输、抖音图片/头像登录校验、凭证与签名 URL 脱敏、NTFS 联接点防护、actcheck/sitecheck严格默认拒绝。subscription.Delete、SQLite 损坏恢复、远程SetAllowMovedFiles、upload--files-from-raw、多节点直播合并、FLVPacketTypeMetadata = 4与 GOP/时间线修复、Media Foundation 实时预览 COM/NV12/采样率修复、PauseAllActiveWork按站点隔离(LOOP-016)。golang.org/x/imagev0.48.0),升级mp4ff至 v0.63.0(tools/depsdue: 0,tools/deps -auditcalled: 0, open: 0)。blocked:将bytednsdoc.com加入DefaultDouyinMediaHosts()(HTTPS 443 +GuardedMediaDialer+ 零 Cookie)。need_set_token=true图文视频页/实况 HTTP 403:透传NeedSetToken,新增仅对www.douyin.com/aweme/v1/play/发带 Cookie 且不自动跟随的ResolvePlayRedirect,解析为无 Cookie 的 CDN 地址后再拉流(CDN 零 Cookie),普通作品直链持续 403/404 时亦支持回退。code=4101152与DYNAMIC_TYPE_LIVE_RCMD:4101152映射为ErrKindUnavailable(“动态不可见或已删除”),动态缓存队列跳过不可缓存的DYNAMIC_TYPE_LIVE_RCMD。library的Statistics/ListItems/LatestPubByAuthor/CountCachedWorks将via.reason="forward"归入转发者名下,不再因转发缓存为原上传者生成多余媒体库作者项。openDouyinWorkFor与douyinCacheFor保留从用户页点入详情页后的ForUID/ForName上下文。Shrink(1)),保留并自动回填旧partial任务的缺失摘要,使用黄色进度条与提醒条区分partial。验证
go run ./tools/check:ALL CHECKS PASSED(全仓测试、双平台依赖方向检查、Linux amd64/arm64 远程构建与 vet、tools/checkdocs、git diff --check HEAD)。go run ./tools/uishots -out artifacts/uishots:192/192 截图与全部断言通过(0 横向溢出)。internal/sitecheck账本,隔离临时目录验证后清理):3 条抖音图文(bytednsdoc.com配乐、need_set_token=true混排视频页与 3 页实况照片)全部一次完成(complete、0 Cookie 泄露,7 次 API、20 次媒体请求)。0.1.3-dev.202611210624(基点bdff0ea62183),tools/package -server、tools/smoke与tools/smoke -server均 PASSED。not-run:go test -race(本机无 CGO/gcc)、桌面实机体验(H-001/H-002)及真实 VPS/Google Drive 实机检查(H-003)。